package cc.xsubj.trading.entity;

import org.newdawn.slick.tiled.TiledMap;

import cc.xsubj.trading.game.TradingGameMain;


public class TeleportPad extends MapTileObject implements Interactable
{
    String destination;

    public TeleportPad(TiledMap map, int groupID, int objectID)
    {
        super(map, groupID, objectID);
        destination = map.getObjectProperty(groupID, objectID, "destination", "");
    }

    public static TeleportPad createFromTiledMapObject(TiledMap map, int groupID,
            int objectID)
    {        
        TeleportPad pad = null;
        pad = new TeleportPad(map, groupID, objectID);
        return pad;
    }

    @Override
    public void interact()
    {
        TradingGameMain game = TradingGameMain.instance();
        game.changeWorld(destination);
    }
    
}
